# 添加 Java 8 镜像来源
FROM openjdk:8-jdk-alpine
# author
MAINTAINER Snail

ENV TZ=Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# 挂载目录
VOLUME /home/snail
# 创建目录
RUN mkdir -p /home/snail
# 指定路径
WORKDIR /home/snail
## 待打入镜像的springboot的jar文件
ENV JAR_FILE=snail-job-admin.jar
# 复制jar文件到路径
COPY target/$JAR_FILE /home/snail
# 执行启动命令
ENTRYPOINT  exec java ${SW_AGENT} -jar -Dfile.encoding=UTF-8  \
        -Djava.security.egd=file:/dev/./urandom \
        -server $JAVA_OPTS \
        -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m \
        -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError \
        -XX:HeapDumpPath=/home/snail/heap_admin-center_9001.hprof -XX:-UseLargePages \
        /home/snail/$JAR_FILE
